package com.wxh.producerconsumer.synchronizedmethod;

/**
 * @ClassName: SynchronizedMethodTest
 * @Description: 同步方法测试
 * @Author wxh
 * @Date: 2021/12/7 10:49
 * @Version V1.0.0
 * @Since 1.8
 */
public class SynchronizedMethodTest {
    public static void main(String[] args) {
        Shop shop = new Shop();

        ProducerThread t1 = new ProducerThread(shop);
        t1.setName("生产者");

        ConsumerThread t2 = new ConsumerThread(shop);
        t2.setName("消费者");

        // 单线程处理
        t1.start();
        t2.start();
    }
}
